翻訳と辞書
Words near each other
・ Simplicia inflexalis
・ Simplicia mistacalis
・ Simplicial approximation theorem
・ Simplicial category
・ Simplicial commutative ring
・ Simplicial complex
・ Simplicial group
・ Simple Pleasure
・ Simple Pleasures
・ Simple Pleasures (Alison Brown album)
・ Simple Pleasures (Bobby McFerrin album)
・ Simple polygon
・ Simple polytope
・ Simple Power
・ Simple precedence grammar
Simple precedence parser
・ Simple present
・ Simple prioritization
・ Simple programmable logic device
・ Simple public-key infrastructure
・ Simple random sample
・ Simple rational approximation
・ Simple resolution
・ Simple ring
・ Simple Science
・ Simple Sensor Interface protocol
・ Simple sequence length polymorphism
・ Simple series
・ Simple Service Discovery Protocol
・ Simple set


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Simple precedence parser : ウィキペディア英語版
Simple precedence parser
In computer science, a simple precedence parser is a type of bottom-up parser for context-free grammars that can be used only by simple precedence grammars.
The implementation of the parser is quite similar to the generic bottom-up parser. A stack is used to store a viable prefix of a sentential form from a rightmost derivation. Symbols \lessdot, \dot = and \gtrdot are used to identify the pivot, and to know when to Shift or when to Reduce.
==Implementation==

* Compute the Wirth–Weber precedence relationship table.
* Start with a stack with only the starting marker $.
* Start with the string being parsed (Input) ended with an ending marker $.
* While not (Stack equals to $S and Input equals to $) (S = Initial symbol of the grammar)
*
* Search in the table the relationship between Top(stack) and NextToken(Input)
*
* if the relationship is \dot = or \lessdot
*
*
* Shift:
*
*
* Push(Stack, relationship)
*
*
* Push(Stack, NextToken(Input))
*
*
* RemoveNextToken(Input)
*
* if the relationship is \gtrdot
*
*
* Reduce:
*
*
* SearchProductionToReduce(Stack)
*
*
* RemovePivot(Stack)
*
*
* Search in the table the relationship between the Non terminal from the production and first symbol in the stack (Starting from top)
*
*
* Push(Stack, relationship)
*
*
* Push(Stack, Non terminal)
SearchProductionToReduce (Stack)
* search the Pivot in the stack the nearest \lessdot from the top
* search in the productions of the grammar which one have the same right side than the Pivot

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Simple precedence parser」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.